package com.koron.css2.newProjectCenter.service;

import com.koron.css2.newProjectCenter.bean.PjProcessNodeTimePostponeBean;
import com.koron.css2.newProjectCenter.bean.PjTerminationBean;
import com.koron.css2.newProjectCenter.mapper.PjProcessNodeTimePostponeMapper;
import com.koron.css2.newProjectCenter.mapper.PjTerminationMapper;
import com.koron.util.Constant;
import org.koron.ebs.mybatis.SessionFactory;
import org.swan.bean.MessageBean;


public class PjInfoServiceImpl implements PjInfoService{

	/**
	 * 用户工程延期
	 */
	@Override
	public MessageBean<?> processDelay(SessionFactory factory, PjProcessNodeTimePostponeBean processNodeTimePostpone) {
		PjProcessNodeTimePostponeMapper mapper = factory.getMapper(PjProcessNodeTimePostponeMapper.class);
		int iCount = mapper.insert(processNodeTimePostpone);
		if(iCount > 0) {
			return MessageBean.create(Constant.MESSAGE_INT_SUCCESS, "添加成功", Void.class);
		}
		return MessageBean.create(Constant.MESSAGE_INT_SUCCESS, "添加失败", Void.class);
	}

	/**
	 * 用户工程终止插入
	 */
	@Override
	public MessageBean<?> termination(SessionFactory factory, PjTerminationBean processTermination) {
		PjTerminationMapper mapper = factory.getMapper(PjTerminationMapper.class);
		int iCount = mapper.insert(processTermination);
		if(iCount > 0) {
			return MessageBean.create(Constant.MESSAGE_INT_SUCCESS, "添加成功", Void.class);
		}
		return MessageBean.create(Constant.MESSAGE_INT_SUCCESS, "添加失败", Void.class);
	}
}
